﻿using AdminBase.Model;
using AdminBase.Model.Entitys;

namespace AdminBase.Interface
{
    /// <summary>
    /// 权限业务接口
    /// </summary>
    public interface IPermissionsService
    {
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="permission"></param>
        /// <returns></returns>
        bool Add(Permissions permission);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="permission"></param>
        /// <returns></returns>
        bool Edit(Permissions permission);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool Del(long id);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        bool BatchDel(List<long> idList);

        /// <summary>
        /// 获取单个
        /// </summary>
        /// <returns></returns>
        PermissionsDto GetPermission(long id);

        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="queryParam">查询参数</param>
        /// <returns></returns>
        PageInfo GetPermissions(PermissionsQueryParam queryParam);

        /// <summary>
        /// 根据用户获取权限ids
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <returns></returns>
        List<long> GetPermissionsIDsByUserID(long userID);

        /// <summary>
        /// 根据用户获取权限
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <returns></returns>
        List<PermissionsDto> GetPermissionsByUserID(long userID);

        /// <summary>
        /// 获取所有权限用于树形
        /// </summary>
        /// <returns></returns>
        List<TreeDto> GetTreeData();

        /// <summary>
        /// 根据用户获取菜单权限（树列表）
        /// </summary>
        /// <returns></returns>
        List<PermissionsDto> GetMenus();

        /// <summary>
        /// 获取权限方法
        /// </summary>
        /// <returns></returns>
        List<ValueLabel> GetPermissionMethods();
    }
}
